﻿@model System.Web.Mvc.ModelStateDictionary

@if (Model != null && !Model.IsValid)
{ 
    <div class="validation-summary-errors" id="validation-summary-errors">
        <div class="messages-close-container" style="float: right; padding: 1px 10px 0px 0px; display: none;">
            <a href="javascript:void(0)" id="close-action">关闭</a>
        </div>
        <div class="messages-container">
            <ul>
                @foreach (var state in Model)
                {
                    foreach (var error in state.Value.Errors)
                    { 
                        <li>
                            @error.ErrorMessage
                        </li>
                    }
                }
            </ul>
        </div>
    </div>
    
    <script type="text/javascript">
        $(function () {
            $("#close-action").click(function () {
                $("#validation-summary-errors").slideUp("normal");
            });
        })
    </script>
}